package com.ticket.sass.admin.dto.output.film;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ticket.sass.admin.util.EscapeUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author ywb
 * @date 2022-07-15 17:37
 */
@Data
@NoArgsConstructor
@ApiModel("排期信息")
public class ScheduleListOutput {
    @ApiModelProperty(value = "ID")
    private Integer id;

    @JsonIgnore
    @ApiModelProperty(value = "放映时间")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "放映日期文本")
    private String startTimeStr;

    @ApiModelProperty(value = "语种")
    private String lang;

    @ApiModelProperty(value = "影片名")
    private String filmName;
    
    @ApiModelProperty(value = "类型")
    private String version;

    @ApiModelProperty(value = "影厅")
    private String hall;

    public String getStartTimeStr() {
        String str = EscapeUtil.dateTimeStr(startTime);
        return str.substring(11, 16);
    }

    public String getFilmName() {
        return EscapeUtil.emptyStr(filmName);
    }
}
